package com.netistate.base;

import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;
import org.apache.struts2.util.ServletContextAware;

import com.opensymphony.xwork2.ActionSupport;

public abstract class BaseAction extends ActionSupport implements ServletContextAware,SessionAware,ServletRequestAware,ServletResponseAware,ApplicationAware{

	private static final long serialVersionUID = 1L;
	private Map<String, Object> application;
	private HttpServletResponse response;
	private HttpServletRequest request;
	private Map<String, Object> session;

	private ServletContext servletContext;
	
	@Override
	public abstract String execute() throws Exception;
	public abstract String save() throws Exception;
	public abstract String del() throws Exception;
	public abstract String findAll() throws Exception;
	public abstract String findById() throws Exception;
	public abstract String update() throws Exception;
	public abstract String edit() throws Exception;
	
	
	public void setResponse(HttpServletResponse response) {
		this.response = response;
	}
	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}
	public void setApplication(Map<String, Object> application) {
		this.application = application;
	}
	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
	public Map<String, Object> getApplication() {
		return application;
	}
	public HttpServletResponse getResponse() {
		return response;
	}
	public HttpServletRequest getRequest() {
		return request;
	}
	public Map<String, Object> getSession() {
		return session;
	}
	public ServletContext getServletContext() {
		return servletContext;
	}
	public void setServletContext(ServletContext servletContext) {
		this.servletContext = servletContext;
	}
	

}
